//
// Created by wangliewei on 2021/8/12.
//
#include <iostream>

using namespace std;

// const int N = 1e6 + 10;
const int N = 1000010;

int n;

int q[N];

void quick_sort(int q[], int l, int r){

    if (l >= r) return;

    int x = q[l + r >> 1], i = l - 1, j = r + 1;//如果去左边界可能会超时
    while (i < j) {
        do i ++ ; while (q[i] < x); //这里不能写大于等于，否则会暴栈
        do j -- ; while (q[j] > x);
        if (i < j)  swap(q[i], q[j]);
    }

    quick_sort(q, l, j);
    quick_sort(q, j + 1, r);
    //也可以这样,细节点
    // quick_sort(q, l, i - 1);
    // quick_sort(q, i, r);

}

int main(){

    scanf("%d", &n);

    for (int i = 0; i < n; i ++) scanf("%d", &q[i]);

    quick_sort(q, 0, n - 1);

    for (int i = 0; i < n; i ++) printf("%d ", q[i]);

    return 0;
}



